/*------------------------------------------------------------------------
* CMSMART Virtuemart Multiupload Plugin
* author : CmsMart Team
* copyright Copyright (C) 2012 www.cms-extensions.net All Rights Reserved.
* @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* Websites: http://cmsmart.net
* Version : 4.0.0
-------------------------------------------------------------------------*/

jQuery(document).ready(function() {
	var upload_form_tmpl = '<fieldset><legend>Multiple Image Upload</legend><div id="file-uploader"><p></p></div><ul id="separate-list"></ul></fieldset>';
	jQuery('.selectimage .checkboxes').first().after(upload_form_tmpl);
	createUploader();
	jQuery('#separate-list').after('<div class="cms_apply"><span>Save</span></div>');
	jQuery('#cms_autosave').click(function (){
		jQuery('#cms_autosave').is(':checked') ? jQuery('.cms_apply').fadeOut() : jQuery('.cms_apply').fadeIn();
	});
	jQuery('.cms_apply').click(function () {
		window.location.reload();
	});
});
